package com.example.backend.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.*;

import java.util.ArrayList;
import java.util.List;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true, doNotUseGetters = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class WeatherData {
    private String city;
    private String dateTime;
    private String currentTemperature;
    private String wind;
    private String humidity;
    private String uvIndex;
    private String coldIndex;
    private String sportIndex;
    private String allergyIndex;
    private String dressIndex;
    private String carWashIndex;
    private List<Forecast> forecast;
    private List<Suggestion> suggestions = new ArrayList<>();

    @Getter
    @Setter
    public static class Forecast {
        private String date;
        private String weather;
        private String temperature;
        private String wind;
        private String icon1;
        private String icon2;
    }

    @Getter
    @Setter
    @AllArgsConstructor
    public static class Suggestion {
        private String index;
        private String message;
    }

    public void formSuggestions() {
        suggestions.add(new Suggestion("防晒指数", uvIndex));
        suggestions.add(new Suggestion("感冒指数", coldIndex));
        suggestions.add(new Suggestion("运动指数", sportIndex));
        suggestions.add(new Suggestion("过敏指数", allergyIndex));
        suggestions.add(new Suggestion("穿衣指数", dressIndex));
        suggestions.add(new Suggestion("洗车指数", carWashIndex));
    }
}

